<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    // 1 typeof 操作符 判断数据类型 判断后输出的结果 是字符串
    var name = "校长"
    console.log(typeof name) //string
    var age = 88;
    console.log(typeof age) //number
    var flag = true;
    console.log(typeof flag) //boolean
    var kk;
    console.log(typeof kk) //undefined
    var myage = null;
    console.log(typeof null) //object   null检测数据类型返回object
    //  typeof检测对象  返回 object
    var obj = {
      name: "小王",
      age: 66
    }
    console.log(typeof obj) //object 
    // typeof检测函数 返回  function 
    var car = function () { }
    console.log(typeof car)
    // typeof 检测 数组 返回object
    var arr = [1, 2, 3]
    console.log(typeof arr)
    // 用typeof 检测NaN 返回 number
    var num = 88 / "你好";//NaN 
    console.log(typeof num)

    // isNaN() 判断是否非数字  是非数字 返回true    不是非数字 返回false
    console.log(isNaN(num))

  </script>
</body>

</html>